.class public Ldata/MarketPupCarAdapter;
.super Landroid/widget/BaseAdapter;
.source "MarketPupCarAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Ldata/MarketPupCarAdapter$Holder;
    }
.end annotation


# instance fields
.field private c:Landroid/content/Context;

.field private cursor:Landroid/database/Cursor;

.field private cv:Landroid/content/ContentValues;

.field private db:Landroid/database/sqlite/SQLiteDatabase;

.field private helper:Ldbclass/DBOpenHelper;

.field private listbean:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lbean/GoodsBean;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .locals 1
    .param p1, "c"    # Landroid/content/Context;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Lbean/GoodsBean;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 50
    .local p2, "listbean":Ljava/util/List;, "Ljava/util/List<Lbean/GoodsBean;>;"
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 51
    iput-object p1, p0, Ldata/MarketPupCarAdapter;->c:Landroid/content/Context;

    .line 52
    iput-object p2, p0, Ldata/MarketPupCarAdapter;->listbean:Ljava/util/List;

    .line 54
    new-instance v0, Ldbclass/DBOpenHelper;

    invoke-direct {v0, p1}, Ldbclass/DBOpenHelper;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Ldata/MarketPupCarAdapter;->helper:Ldbclass/DBOpenHelper;

    .line 55
    iget-object v0, p0, Ldata/MarketPupCarAdapter;->helper:Ldbclass/DBOpenHelper;

    invoke-virtual {v0}, Ldbclass/DBOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    iput-object v0, p0, Ldata/MarketPupCarAdapter;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 57
    return-void
.end method

.method static synthetic access$0(Ldata/MarketPupCarAdapter;)Ljava/util/List;
    .locals 1

    .prologue
    .line 46
    iget-object v0, p0, Ldata/MarketPupCarAdapter;->listbean:Ljava/util/List;

    return-object v0
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 70
    iget-object v0, p0, Ldata/MarketPupCarAdapter;->listbean:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .param p1, "arg0"    # I

    .prologue
    .line 75
    const/4 v0, 0x0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .param p1, "arg0"    # I

    .prologue
    .line 80
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public getList()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lbean/GoodsBean;",
            ">;"
        }
    .end annotation

    .prologue
    .line 60
    iget-object v0, p0, Ldata/MarketPupCarAdapter;->listbean:Ljava/util/List;

    return-object v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .param p1, "position"    # I
    .param p2, "view"    # Landroid/view/View;
    .param p3, "arg2"    # Landroid/view/ViewGroup;

    .prologue
    .line 88
    if-nez p2, :cond_2

    .line 89
    new-instance v1, Ldata/MarketPupCarAdapter$Holder;

    invoke-direct {v1, p0}, Ldata/MarketPupCarAdapter$Holder;-><init>(Ldata/MarketPupCarAdapter;)V

    .line 90
    .local v1, "holder":Ldata/MarketPupCarAdapter$Holder;
    iget-object v2, p0, Ldata/MarketPupCarAdapter;->c:Landroid/content/Context;

    invoke-static {v2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v2

    const v3, 0x7f03009f

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 91
    const v2, 0x7f0c0061

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv1:Landroid/widget/TextView;

    .line 92
    const v2, 0x7f0c0081

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv2:Landroid/widget/TextView;

    .line 93
    const v2, 0x7f0c0236

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv3:Landroid/widget/TextView;

    .line 94
    const v2, 0x7f0c0082

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->addbtn:Landroid/widget/ImageView;

    .line 95
    const v2, 0x7f0c0080

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->delbtn:Landroid/widget/ImageView;

    .line 96
    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 101
    :goto_0
    iget-object v2, p0, Ldata/MarketPupCarAdapter;->listbean:Ljava/util/List;

    invoke-interface {v2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lbean/GoodsBean;

    .line 102
    .local v0, "bean":Lbean/GoodsBean;
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv1:Landroid/widget/TextView;

    invoke-virtual {v0}, Lbean/GoodsBean;->getname()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 103
    invoke-virtual {v0}, Lbean/GoodsBean;->getGgid()Ljava/lang/String;

    move-result-object v2

    if-nez v2, :cond_0

    .line 104
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv2:Landroid/widget/TextView;

    invoke-virtual {v0}, Lbean/GoodsBean;->getcounts()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 106
    :cond_0
    invoke-virtual {v0}, Lbean/GoodsBean;->getGgid()Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_1

    .line 107
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv2:Landroid/widget/TextView;

    invoke-virtual {v0}, Lbean/GoodsBean;->getGgnum()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 109
    :cond_1
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->tv3:Landroid/widget/TextView;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0}, Lbean/GoodsBean;->getcost()F

    move-result v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 111
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->addbtn:Landroid/widget/ImageView;

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V

    .line 112
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->delbtn:Landroid/widget/ImageView;

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V

    .line 114
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->addbtn:Landroid/widget/ImageView;

    new-instance v3, Ldata/MarketPupCarAdapter$1;

    invoke-direct {v3, p0}, Ldata/MarketPupCarAdapter$1;-><init>(Ldata/MarketPupCarAdapter;)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 140
    iget-object v2, v1, Ldata/MarketPupCarAdapter$Holder;->delbtn:Landroid/widget/ImageView;

    new-instance v3, Ldata/MarketPupCarAdapter$2;

    invoke-direct {v3, p0}, Ldata/MarketPupCarAdapter$2;-><init>(Ldata/MarketPupCarAdapter;)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 162
    return-object p2

    .line 98
    .end local v0    # "bean":Lbean/GoodsBean;
    .end local v1    # "holder":Ldata/MarketPupCarAdapter$Holder;
    :cond_2
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ldata/MarketPupCarAdapter$Holder;

    .restart local v1    # "holder":Ldata/MarketPupCarAdapter$Holder;
    goto :goto_0
.end method

.method public setList(Ljava/util/List;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lbean/GoodsBean;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 64
    .local p1, "listbean":Ljava/util/List;, "Ljava/util/List<Lbean/GoodsBean;>;"
    iput-object p1, p0, Ldata/MarketPupCarAdapter;->listbean:Ljava/util/List;

    .line 65
    return-void
.end method
